package com.zyj.order.service.impl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.zyj.order.common.api.CommonResult;
import com.zyj.order.dto.ProductDTO;
import com.zyj.order.mapper.ProductMapper;
import com.zyj.order.model.Product;
import com.zyj.order.service.ProductService;
import com.zyj.order.vo.ProductVO;

@Service
//@org.springframework.stereotype.Service
public class ProductServiceImpl implements ProductService{

	@Autowired
	private ProductMapper productMapper;
	
	@Override
	public CommonResult<ProductVO> findProduct(ProductDTO dto) {
		Integer productId = dto.getProductId();
		Product product = productMapper.selectByPrimaryKey(productId);
		ProductVO vo = new ProductVO();
		vo.setProductId(product.getId());
		vo.setProductName(product.getProductName());
		return CommonResult.success(vo);
	}

}
